﻿using UnityEngine;

public abstract class IUIBase
{
    protected UnityGameObject gameObjUI = new UnityGameObject();

    public IUIBase(string uiPrefabName)
    {
        gameObjUI.Instantiate(uiPrefabName, Vector3.zero, Quaternion.identity);
    }

    /// <summary>
    /// 更新
    /// </summary>
    /// <param name="deltaTime"></param>
    public virtual void Update(float deltaTime) { }

    public virtual void Destroy()
    {
        gameObjUI.Destroy();
    }

    public virtual void Show()
    {
        gameObjUI.Show();
    }

    public virtual void Hide()
    {
        gameObjUI.Hide();
    }

    public UnityGameObject GetUnityGameObject()
    {
        return gameObjUI;
    }
}
